Integrand size = 39, antiderivative size = 62 \[ \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {(A-B) x}{a}+\frac {(2 A-B+C) \sin (c+d x)}{a d}-\frac {(A-B+C) \sin (c+d x)}{d (a+a \sec (c+d x))} \]
Time = 0.42 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.06 \[ \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\sin (c+d x) \left (\frac {2 A-B+C+A \cos (c+d x)}{1+\cos (c+d x)}+\frac {(A-B) \arcsin (\cos (c+d x))}{\sqrt {\sin ^2(c+d x)}}\right )}{a d} \]
(Sin[c + d*x]*((2*A - B + C + A*Cos[c + d*x])/(1 + Cos[c + d*x]) + ((A - B )*ArcSin[Cos[c + d*x]])/Sqrt[Sin[c + d*x]^2]))/(a*d)
Time = 0.45 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.02, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3042, 4572, 3042, 4274, 24, 3042, 3117}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a \sec (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2}{\csc \left (c+d x+\frac {\pi }{2}\right ) \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )}dx\) |
\(\Big \downarrow \) 4572 |
\(\displaystyle \frac {\int \cos (c+d x) (a (2 A-B+C)-a (A-B) \sec (c+d x))dx}{a^2}-\frac {(A-B+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (2 A-B+C)-a (A-B) \csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx}{a^2}-\frac {(A-B+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {a (2 A-B+C) \int \cos (c+d x)dx-a (A-B) \int 1dx}{a^2}-\frac {(A-B+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {a (2 A-B+C) \int \cos (c+d x)dx-a x (A-B)}{a^2}-\frac {(A-B+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a (2 A-B+C) \int \sin \left (c+d x+\frac {\pi }{2}\right )dx-a x (A-B)}{a^2}-\frac {(A-B+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 3117 |
\(\displaystyle \frac {\frac {a (2 A-B+C) \sin (c+d x)}{d}-a x (A-B)}{a^2}-\frac {(A-B+C) \sin (c+d x)}{d (a \sec (c+d x)+a)}\) |
-(((A - B + C)*Sin[c + d*x])/(d*(a + a*Sec[c + d*x]))) + (-(a*(A - B)*x) + (a*(2*A - B + C)*Sin[c + d*x])/d)/a^2
3.5.54.3.1 Defintions of rubi rules used
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a _))^(m_), x_Symbol] :> Simp[(-(a*A - b*B + a*C))*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(a*f*(2*m + 1))), x] - Simp[1/(a*b*(2*m + 1)) Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n*Simp[a*B*n - b*C*n - A*b*(2*m + n + 1) - (b*B*(m + n + 1) - a*(A*(m + n + 1) - C*(m - n)))*Csc[ e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, C, n}, x] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)]
Time = 0.18 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.71
method | result | size |
parallelrisch | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (A \cos \left (d x +c \right )+2 A -B +C \right )-d x \left (A -B \right )}{d a}\) | \(44\) |
derivativedivides | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\frac {2 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-2 \left (A -B \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(87\) |
default | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\frac {2 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-2 \left (A -B \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(87\) |
risch | \(-\frac {A x}{a}+\frac {B x}{a}-\frac {i A \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {i A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {2 i A}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}\) | \(122\) |
norman | \(\frac {\frac {\left (A -B \right ) x}{a}+\frac {\left (A -B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{a d}+\frac {2 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}-\frac {\left (A -B \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{a}-\frac {\left (3 A -B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\) | \(134\) |
Time = 0.27 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.03 \[ \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {{\left (A - B\right )} d x \cos \left (d x + c\right ) + {\left (A - B\right )} d x - {\left (A \cos \left (d x + c\right ) + 2 \, A - B + C\right )} \sin \left (d x + c\right )}{a d \cos \left (d x + c\right ) + a d} \]
-((A - B)*d*x*cos(d*x + c) + (A - B)*d*x - (A*cos(d*x + c) + 2*A - B + C)* sin(d*x + c))/(a*d*cos(d*x + c) + a*d)
\[ \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\int \frac {A \cos {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \]
(Integral(A*cos(c + d*x)/(sec(c + d*x) + 1), x) + Integral(B*cos(c + d*x)* sec(c + d*x)/(sec(c + d*x) + 1), x) + Integral(C*cos(c + d*x)*sec(c + d*x) **2/(sec(c + d*x) + 1), x))/a
Leaf count of result is larger than twice the leaf count of optimal. 165 vs. \(2 (62) = 124\).
Time = 0.31 (sec) , antiderivative size = 165, normalized size of antiderivative = 2.66 \[ \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {A {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - B {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - \frac {C \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \]
-(A*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - 2*sin(d*x + c)/((a + a* sin(d*x + c)^2/(cos(d*x + c) + 1)^2)*(cos(d*x + c) + 1)) - sin(d*x + c)/(a *(cos(d*x + c) + 1))) - B*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - s in(d*x + c)/(a*(cos(d*x + c) + 1))) - C*sin(d*x + c)/(a*(cos(d*x + c) + 1) ))/d
Time = 0.31 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.45 \[ \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {\frac {{\left (d x + c\right )} {\left (A - B\right )}}{a} - \frac {A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {2 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a}}{d} \]
-((d*x + c)*(A - B)/a - (A*tan(1/2*d*x + 1/2*c) - B*tan(1/2*d*x + 1/2*c) + C*tan(1/2*d*x + 1/2*c))/a - 2*A*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2* c)^2 + 1)*a))/d
Time = 16.02 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.06 \[ \int \frac {\cos (c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A-B+C\right )}{a\,d}-\frac {x\,\left (A-B\right )}{a}+\frac {2\,A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )} \]